package com.bmit.clusterspring.util;

import java.util.List;

public class RateUtils {
    public static final int ASC = 0;
    public static final int DESC = 1;

    public static int insertPosition(List<Double> list, Double num, int orderBy) {
        int cnt = 1;
        if (orderBy == ASC) {
            for (Double i : list) {
                if (i < num) cnt++;
            }
        } else {
            for (Double i : list) {
                if (i > num) cnt++;
            }
        }
        return cnt;
    }
}
